package ua.mk.chdu.rtem.diploma.core.utils;

import ua.mk.chdu.rtem.diploma.core.model.vo.Performance;
import ua.mk.chdu.rtem.diploma.core.model.vo.PerformanceReportVO;

public class PerformanceUtil {
    /**
     * Utility method to get available memory size.
     *
     * @return value wich represent available memory size in megabytes.
     */
    public static PerformanceReportVO generatePerformanceReport() {
        double freeMemorySize = (Runtime.getRuntime().freeMemory() / (1024 * 1024));
        Performance performance = new Performance(freeMemorySize);
        return new PerformanceReportVO(performance);
    }
}
